home *** CD-ROM | disk | FTP | other *** search
/ BCI NET 2 / BCI NET 2.iso / archives / programming / amos / amoslist-0195.lzh / AMOSLIST / text0187.txt < prev    next >
Encoding:
Text File  |  1995-02-01  |  10.0 KB  |  336 lines

  1. Ok, here it is.
  2.  
  3. Set Buffer 5
  4.  
  5. Screen Open 1,640,400,8,Hires+Laced
  6.  
  7.  
  8. _REQUESTER_PROCEDURES_STARTUP:
  9. Dim WINSCROL$(200)
  10. Global WINSCROL$()
  11. Wind Save
  12. Reserve Zone 4
  13.  
  14. '******************************************************************************
  15. *********'
  16. ' Subroutines and procedures start here
  17. '******************************************************************************
  18. ***********'
  19.  
  20. Procedure
  21. RQB[PAPR,HILITE,SHADE,TXT,INFO$,BUTTONS,BTCOL,BUTTON1$,BUTTON2$,BUTTON3$,BUTTON
  22. $]
  23. Wind Open 99,160,50,40,10,2
  24. Scroll Off
  25. Paper PAPR : Pen TXT
  26. Clw : Curs Off
  27. Border 2,PAPR,HILITE
  28. Ink SHADE : Draw 486,51 To 486,129 : Draw 487,51 To 487,129
  29. Draw 169,129 To 487,129 : Box 173,53 To 482,109
  30. Ink HILITE : Polyline 482,54 To 482,109 To 174,109
  31.  
  32. _TEXT_CENTRE:
  33. If Len(INFO$)<37 Then Centre INFO$ : Goto BUTTON
  34. A=0
  35. For B=37 To 1 Step -1
  36. If Mid$(INFO$,B,1)=" " Then A=B : B=1
  37. Next B
  38. A$=Left$(INFO$,A-1) : B=Len(INFO$)-A
  39. B$=Right$(INFO$,B) :4 INFO$=B$
  40. Centre A$ : Print
  41. Goto _TEXT_CENTRE
  42.  
  43. BUTTON:
  44. On BUTTONS Goto BUTTON1,BUTTON2,BUTTON3,BUTTON4
  45.  
  46. BUTTON1:
  47. Paper PAPR : Pen BTCOL
  48. A$=BUTTON1$+"        " : B$=Left$(A$,8)
  49. Locate 30,7 : Print B$
  50. Ink HILITE : Box 412,112 To 481,123
  51. Ink SHADE : Polyline 481,113 To 481,123 To 413,123
  52. Set Zone 1,412,112 To 481,123 : Goto CLICK
  53.  
  54. BUTTON2:
  55. Paper PAPR : Pen BTCOL
  56. A$=BUTTON1$+"        " : B$=Left$(A$,8)
  57. Locate 30,7 : Print B$
  58. Ink HILITE : Box 412,112 To 481,123
  59. Ink SHADE : Polyline 481,113 To 481,123 To 413,123
  60. Set Zone 1,412,112 To 481,123
  61. A$=BUTTON2$+"        " : B$=Left$(A$,8)
  62. Locate 0,7 : Print B$
  63. Ink HILITE : Box 173,112 To 241,123
  64. Ink SHADE : Polyline 241,113 To 241,123 To 174,123
  65. Set Zone 2,173,112 To 241,123 : Goto CLICK
  66.  
  67. BUTTON3:
  68. Paper PAPR : Pen BTCOL
  69. A$=BUTTON1$+"        " : B$=Left$(A$,8)
  70. Locate 30,7 : Print B$
  71. Ink HILITE : Box 412,112 To 481,123
  72. Ink SHADE : Polyline 481,113 To 481,123 To 413,123
  73. Set Zone 1,412,112 To 481,123
  74. A$=BUTTON2$+"        " : B$=Left$(A$,8)
  75. Locate 0,7 : Print B$
  76. Ink HILITE : Box 173,112 To 241,123
  77. Ink SHADE : Polyline 241,113 To 241,123 To 174,123
  78. Set Zone 2,173,112 To 241,123
  79. A$=BUTTON3$+"        " : B$=Left$(A$,8)
  80. Locate 10,7 : Print B$
  81. Ink HILITE : Box 252,112 To 321,123
  82. Ink SHADE : Polyline 321,113 To 321,123 To 253,123
  83. Set Zone 3,252,112 To 321,123 : Goto CLICK
  84.  
  85. BUTTON4:
  86. Paper PAPR : Pen BTCOL
  87. A$=BUTTON1$+"        " : B$=Left$(A$,8)
  88. Locate 30,7 : Print B$
  89. Ink HILITE : Box 412,112 To 481,123
  90. Ink SHADE : Polyline 481,113 To 481,123 To 413,123
  91. Set Zone 1,412,112 To 481,123
  92. A$=BUTTON2$+"        " : B$=Left$(A$,8)
  93. Locate 0,7 : Print B$
  94. Ink HILITE : Box 173,112 To 241,123
  95. Ink SHADE : Polyline 241,113 To 241,123 To 174,123
  96. Set Zone 2,173,112 To 241,123
  97. A$=BUTTON3$+"        " : B$=Left$(A$,8)
  98. Locate 10,7 : Print B$
  99. Ink HILITE : Box 252,112 To 321,123
  100. Ink SHADE : Polyline 321,113 To 321,123 To 253,123
  101. Set Zone 3,252,112 To 321,123
  102. A$=BUTTON4$+"        " : B$=Left$(A$,8)
  103. Locate 20,7 : Print B$
  104. Ink HILITE : Box 332,112 To 401,123
  105. Ink SHADE : Polyline 401,113 To 401,123 To 333,123
  106. Set Zone 4,332,112 To 401,123 : Goto CLICK
  107.  
  108. CLICK:
  109. K=Mouse Key : Z=Mouse Zone
  110. If K=0 Then Goto CLICK
  111. If Z=0 Then Goto CLICK
  112. If Z=1 Then IN$="1" : Goto OUT
  113. If Z=2 Then IN$="2" : Goto OUT
  114. If Z=3 Then IN$="3" : Goto OUT
  115. If Z=4 Then IN$="4"
  116.  
  117. OUT:
  118. Scroll On
  119. Wind Close
  120. End Proc[IN$]
  121.  
  122. Procedure RQI[PAPR,HILITE,SHADE,TXT,INFO$,INBAK,NTXT,INLNG]
  123. Do : A$=Inkey$ : If A$<>"" Then Loop
  124. Wind Open 99,160,50,40,10,2
  125. Scroll Off
  126. Paper PAPR : Pen TXT
  127. Clw : Curs Off
  128. Border 2,PAPR,HILITE
  129. Ink SHADE : Draw 486,51 To 486,129 : Draw 487,51 To 487,129
  130. Draw 169,129 To 487,129 : Box 173,53 To 482,109
  131. Ink HILITE : Polyline 482,54 To 482,109 To 174,109
  132. _TEXT_CENTRE:
  133. If Len(INFO$)<37 Then Centre INFO$ : Goto TEST
  134. A=0
  135. For B=37 To 1 Step -1
  136. If Mid$(INFO$,B,1)=" " Then A=B : B=1
  137. Next B
  138. A$=Left$(INFO$,A-1) : B=Len(INFO$)-A
  139. B$=Right$(INFO$,B) : INFO$=B$
  140. Centre A$ : Print
  141. Goto _TEXT_CENTRE
  142.  
  143. TEST:
  144. IN$=""
  145. Paper INBAK : Pen NTXT
  146. Locate 1,5 : Print "                                    "
  147. Ink SHADE : Box 182,97 To 472,106
  148. Ink HILITE : Polyline 472,98 To 472,106 To 183,106
  149. Paper INBAK : Pen HILITE : Locate 1,5 : Print "<";Cleft$;
  150.  
  151. _INPUT:
  152. If INLNG<1 Then INLNG=1
  153. If INLNG>35 Then INLNG=35
  154. Do : A$=Inkey$ : If A$="" Then Loop
  155. If A$=Chr$(8) and Len(IN$)=0 Then Goto _INPUT
  156. If A$=Chr$(13) Then Goto OUT
  157. If A$=Chr$(8) Then IN$=Left$(IN$,Len(IN$)-1) : Pen HILITE : Print "
  158. ";Cleft$;Cleft$;"<";Cleft$; : Pen NTXT : Goto _INPUT
  159. If Asc(A$)<32 Then Goto _INPUT
  160. If Len(IN$)=INLNG Then Goto _INPUT
  161. IN$=IN$+A$ : Pen NTXT : Print A$; : Pen HILITE : Print "<";Cleft$; : A$="" :
  162. Goto _INPUT
  163.  
  164. OUT:
  165. Scroll On
  166. Wind Close
  167. End Proc[IN$]
  168.  
  169. Procedure RQS[PAPR,HILITE,SHADE,TXT,INFO$,BKGD,SELCOL,UNSELCOL,INLNG]
  170. Do : A$=Inkey$ : If A$<>"" Then Loop
  171. SC=1
  172. Wind Open 99,160,50,40,10,2
  173. Scroll Off
  174. Paper PAPR : Pen TXT
  175. Clw : Curs Off
  176. Border 2,PAPR,HILITE
  177. Ink SHADE : Draw 486,51 To 486,129 : Draw 487,51 To 487,129
  178. Draw 169,129 To 487,129 : Ink BKGD : Bar 174,65 To 481,108
  179. Ink SHADE : Box 173,53 To 482,109
  180. Ink HILITE : Polyline 482,54 To 482,109 To 174,109
  181.  
  182. _TEXT_CENTRE:
  183. A=Len(INFO$) : A$="                   "
  184. B=38-A
  185. A=B/2
  186. A$=Left$(A$,A)+INFO$+A$
  187. INFO$=Left$(A$,38)
  188. Locate 0,0 : Ink TXT,PAPR : Text 176,61,INFO$
  189. Ink SHADE : Draw 173,64 To 482,64
  190. Ink HILITE : Draw 174,63 To 482,63
  191.  
  192. BUTTONS:
  193. Paper PAPR : Pen BTCOL
  194. Locate 30,7 : Print " Select "
  195. Ink HILITE : Box 412,112 To 481,123
  196. Ink SHADE : Polyline 481,113 To 481,123 To 413,123
  197. Set Zone 1,412,112 To 481,123
  198. Locate 0,7 : Print "   Up   "
  199. Ink HILITE : Box 173,112 To 241,123
  200. Ink SHADE : Polyline 241,113 To 241,123 To 174,123
  201. Set Zone 2,173,112 To 241,123
  202. Locate 10,7 : Print "  Down  "
  203. Ink HILITE : Box 252,112 To 321,123
  204. Ink SHADE : Polyline 321,113 To 321,123 To 253,123
  205. Set Zone 3,252,112 To 321,123
  206.  
  207. Gosub DISPLAY
  208.  
  209. CLICK:
  210. A$="" : S=0 : K=0 : Z=0
  211. A$=Inkey$ : S=Scancode : K=Mouse Key : Z=Mouse Zone
  212. If A$=Chr$(13) Then Goto OUT
  213. If Z=1 and K=1 Then Goto OUT
  214. If S=76 Then SC=SC+1 : Goto CLICK1
  215. If Z=2 and K=1 Then SC=SC+1 : Goto CLICK1
  216. If S=77 Then SC=SC-1 : Goto CLICK1
  217. If Z=3 and K=1 Then SC=SC-1 : Goto CLICK1
  218. Goto CLICK
  219. CLICK1:
  220. If SC>INLNG Then SC=INLNG
  221. If SC<1 Then SC=1
  222. Gosub DISPLAY
  223. Goto CLICK
  224.  
  225. DISPLAY:
  226. A$="                                      "
  227. B$=WINSCROL$(SC)+A$
  228. C$=Left$(B$,38)
  229. Paper SELCOL : Pen BKGD : Locate 0,1 : Print C$
  230. If SC=INLNG Then Paper BKGD : Locate 0,2 : Print A$
  231. If SC+1>INLNG Then Return
  232. B$=WINSCROL$(SC+1)+A$
  233. C$=Left$(B$,38)
  234. Paper BKGD : Pen UNSELCOL : Locate 0,2 : Print C$
  235. If SC+1=INLNG Then Locate 0,3 : Print A$
  236. If SC+2>INLNG Then Return
  237. B$=WINSCROL$(SC+2)+A$
  238. C$=Left$(B$,38)
  239. Paper BKGD : Pen UNSELCOL : Locate 0,3 : Print C$
  240. If SC+2=INLNG Then Locate 0,4 : Print A$
  241. If SC+3>INLNG Then Return
  242. B$=WINSCROL$(SC+3)+A$
  243. C$=Left$(B$,38)
  244. Paper BKGD : Pen UNSELCOL : Locate 0,4 : Print C$
  245. If SC+3=INLNG Then Locate 0,5 : Print A$
  246. If SC+4>INLNG Then Return
  247. B$=WINSCROL$(SC+4)+A$
  248. C$=Left$(B$,38)
  249. Paper BKGD : Pen UNSELCOL : Locate 0,5 : Print C$
  250. Return
  251.  
  252. OUT:
  253. Paper PAPR : Pen BKGD
  254. IN$=WINSCROL$(SC)
  255. Scroll On
  256. Wind Close
  257. End Proc[IN$]
  258.  
  259. 'DOCs
  260.  
  261. 'in order for this set of procedures to work, you must use the following
  262. 'commands before opening any windows
  263. '
  264. ' Dim WINSCROL$(200)     Sets up the scroll procedure array
  265. ' Global WINSCROL$()     Makes the array global so the procedure can use it
  266. ' Wind Save              Activates the window save command to keep the
  267. '                        display from being corrupted
  268. ' Reserve Zone 4         Reserves the zones for the requester buttons.  You
  269. '                        may use any zones higher than 4 for your own work
  270.  
  271. 'RQB (requester with buttons)
  272.  
  273. 'PAPR     - main color of the requester              eg $999
  274. 'HILITE   - color of hilights on requester           eg $CCC
  275. 'SHADE    - color of shadows on requester            eg $666
  276. 'TXT      - color of info$ test printed in requester eg $FFF
  277. 'INFO$    - text to be printed (6 lines of 37 chars max. & it autocentres)
  278. 'BUTTONS  - number of buttons 1 to 4 (display order [2] [3] [4] [1])
  279. 'BTCOL    - color of the text inside the buttons     eg $000
  280. 'BUTTON1$ - text of button 1 (up to 8 chars)
  281. 'BUTTON2$ - text of button 2 (up to 8 chars)
  282. 'BUTTON3$ - text of button 3 (up to 8 chars)
  283. 'BUTTON4$ - text of button 4 (up to 8 chars)
  284.  
  285. 'NOTE: the example colors are what you should set your colors to with
  286. '      the colour1,$AAA command.  The requester expects a value such
  287. '      as 1 or 4
  288.  
  289. 'after execution the param$ will contain either "1", "2", "3" or "4"
  290.  
  291. 'RQI (requester for input)
  292.  
  293. 'PAPR     - main color of the requester              eg $999
  294. 'HILITE   - color of hilights on requester           eg $CCC
  295. 'SHADE    - color of shadows on requester            eg $666
  296. 'TXT      - color of info$ test printed in requester eg $FFF
  297. 'INFO$    - text to be printed (6 lines of 37 chars max. & it autocentres)
  298. 'INBAK    - color of background in input bar         eg $000
  299. 'NTXT     - color of text input                      eg $0F0
  300. 'INLNG    - length of input text allowed (1-35)
  301.  
  302. 'NOTE: the example colors are what you should set your colors to with
  303. '      the colour1,$AAA command.  The requester expects a value such
  304. '      as 1 or 4
  305.  
  306. 'after execution the param$ will contain the text that was entered
  307.  
  308. 'RQS (requester for scrolling through a list)
  309.  
  310. 'Before calling this routine, copy your data to be displayed into the
  311. 'winscrol$() array
  312.  
  313. 'PAPR     - main color of the requester              eg $999
  314. 'HILITE   - color of hilights on requester           eg $CCC
  315. 'SHADE    - color of shadows on requester            eg $666
  316. 'TXT      - color of info$ test printed in requester eg $FFF
  317. 'INFO$    - text to be printed (6 lines of 37 chars max. & it autocentres)
  318. 'BKGD     - color of background fro scroll window    eg $000
  319. 'SELCOL   - color of highlighted (top) item          eg $0F0
  320. 'UNSELCOL - color of other items in list             eg $00F
  321. 'INLNG    - number of items in winscrol$() (1-200)
  322.  
  323. 'NOTE: the example colors are what you should set your colors to with
  324. '      the colour1,$AAA command.  The requester expects a value such
  325. '      as 1 or 4
  326.  
  327. 'after execution the param$ will contain the text from the item that
  328. 'was in the highlight bar
  329.  
  330. I also included my other two requester procedures.  If you use them in your
  331. programs, give credit to Giark.
  332.  
  333. Well met and godspeed,
  334.                       Giark
  335.  
  336.